package com.kun.utils;

import java.util.Scanner;

public class ConsoleUtil {

    /**
     * 获取用户输入的命令集
     * @return 用户命令集
     */
    public static String[] getInputCommands(){
        System.out.println("attention: 空行后再换行可结束输入...");
        StringBuilder sb = new StringBuilder();
        Scanner scanner = new Scanner(System.in);
        while(true)
        {
            String text = scanner.nextLine().trim();
            if ("".equals(text))
            {
                break;
            }
            sb.append(text+"_");
        }
        return sb.toString().split("_");
    }
}
